home *** CD-ROM | disk | FTP | other *** search
- /* #[info: */
- /************************************************************************
- * *
- * ####### #### #### # #### *
- * # # # # # # # *
- * # # # # # # # *
- * # # # # # # ### *
- * # # # # # # # *
- * # # # # # # # *
- * # #### #### ###### #### *
- * *
- * Jan van der Steen *
- * *
- * Centre for Mathematics and Computer Science *
- * Amsterdam, the Netherlands *
- * *
- *----------------------------------------------------------------------*
- * File : tools.c *
- * Purpose : Various tools *
- * Version : 1.1 *
- * Modified: 11/8/92 17:00:54 *
- * Author : Jan van der Steen (jansteen@cwi.nl) *
- ************************************************************************/
- /* #]info: */
- /* #[include: */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "tools.h"
-
- /* #]include: */
-
- /* #[string_alloc: */
-
- char *
- string_alloc(s)
- char *s;
- {
- char *t = (char *) malloc(strlen(s)+1);
-
- if (t == (char *) 0) {
- fprintf(stderr, "Out of memory in string_alloc\n");
- exit(1);
- }
- return t;
- }
-
- /* #]string_alloc: */
- /* #[string_store: */
-
- char *
- string_store(s)
- char *s;
- {
- return strcpy(string_alloc(s), s);
- }
-
- /* #]string_store: */
-